/*
 * Created by SharpDevelop.
 */
using System;

namespace MiniMIPS
{
	/// <summary>
	/// Description of BinaryString.
	/// </summary>
	public static class BinaryString
	{
		
		public static string FromInt(int val, int width)
		{
			string s = Convert.ToString(val, 2);
			
			s = s.PadLeft(width, '0');
			
			return s.Substring(s.Length - width, width);
		}
		
		public static string FromUInt(uint val, int width)
		{
			string s = Convert.ToString(val, 2);
			
			s = s.PadLeft(width, '0');
			
			return s.Substring(s.Length - width, width);
		}
	}
}
